<template>
    <!-- 二级页面入口 -->
    <router-view class="expend-main-router-view" :goBackPage="goBackPage">
    </router-view>
</template>

<script lang="ts">
import { invokeArrayFns } from '@vue/shared';
import { defineComponent } from 'vue'
import { useStore } from 'vuex';
import { useRouter } from 'vue-router';

export default defineComponent({
    setup() {
        const store = useStore();
        const router = useRouter();
        return {
            goBackPage(isBackReload: boolean) {
                const route = store.getters['router/expandRouterName'];
                if (route) {
                    router.push({ name: route.to });
                    return;
                }
                if (isBackReload) {
                    setTimeout(() => {
                        window.location.reload();
                    }, 300);
                }
                window.history.go(-1);
            }
        }
    }
})
</script>

<style scoped>

</style>